#include "logo.h"

char *getValue(void);

void run(void)
{

     char *pro;
     char *command;
     char proStr[MAXVALUE] ="\0";
     char cmd[MAXVALUE] ="\0";
     int i;
     char *cmdName[]=
       {"MAKE","PRINT","RUN","IF","TEST","IFTRUE","IFFALSE","REPEAT","ERASE","ERASEALL","WAIT","LOAD","SAVE","TO"};
     int cmdNumber= sizeof(cmdName)/sizeof(char*);
     void (*cmdP[])(void)=
       {make,print,run,cmdIf,test,iftrue,iffalse,repeat,erase,erase,eraseall,wait,load,save};
        //to,};

     pro =proStr;
     command =cmd;
     printf("welcome to run\n");
     strcpy(pro,getValue());
     i =strlen(pro)-1;
     //printf("run list is :");
     while (i)
     {
/*           if ((pro[i] == '[')||(pro[i] == ']'))
              {
                       i--;
                       continue;
              }*/
           putcharInput(pro[i]);
     //      printf("%c",pro[i]);
           i--;
     }
     //printf("input is %s.\n",input);
/*     printf("run list is %s\n",pro);
     sscanf(pro,"%[^]]",pro);
     printf("run list is %s\n",pro);
     if (pro[0] =='[')
     {
        pro =pro+1;
        printf("run list is %s\n",pro);
     }*/
     while (((input[0] != ']')&&(!isspace(input[0]))) || (strlen(input) >1))
     {
           getCmd();
           printf("input is %s.\n",input);
     }
     return;
}
